package com.mian.netty.demo.service;

import com.mian.annotation.RemoteService;
import com.mian.netty.demo.GreeterGrpc;
import com.mian.netty.demo.HelloReply;
import com.mian.netty.demo.HelloRequest;
import io.grpc.stub.StreamObserver;

@RemoteService
public class GreeterImpl extends GreeterGrpc.GreeterImplBase {

    @Override
    public void sayHello(HelloRequest req, StreamObserver<HelloReply> responseObserver) {
        HelloReply reply = HelloReply.newBuilder().setMessage("王大锤1: " + req.getName()).build();
        responseObserver.onNext(reply);
        responseObserver.onCompleted();
    }

}